/*
 * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.inspur.edp.sgf.provider.vo.utils;

import com.inspur.edp.lcm.metadata.api.entity.GspMetadata;
import com.inspur.edp.sgf.api.common.SummaryInfo;
import com.inspur.edp.sgf.api.entity.ServiceOperation;
import com.inspur.edp.sgf.provider.vo.basic.SimpleBasicActionProvider;
import com.inspur.edp.sgf.provider.vo.basic.SimpleBasicActionSummary;
import com.inspur.edp.sgf.provider.vo.custom.SimpleCustomActionProvider;
import com.inspur.edp.sgf.provider.vo.custom.SimpleCustomActionSummary;

import java.util.ArrayList;
import java.util.List;

/**
 * 功能描述:
 *
 * @ClassName: SimpleViewModelUtils
 * @Author: Fynn Qi
 * @Date: 2020/9/1 10:59
 * @Version: V1.0
 */
public class SimpleViewModelUtils {

    public static List<ServiceOperation> getAllOperations(GspMetadata metadata) {
        List<ServiceOperation> operations = new ArrayList<>();
        operations.addAll(SimpleBasicActionProvider.getSimpleBasicActions(metadata));
        operations.addAll(SimpleCustomActionProvider.getSimpleCustomActions(metadata));
        return operations;
    }

    public static List<ServiceOperation> getAllBasicOperations(GspMetadata metadata) {
        return SimpleBasicActionProvider.getSimpleBasicActions(metadata);
    }

    public static List<ServiceOperation> getAllCustomOperations(GspMetadata metadata) {
        return SimpleCustomActionProvider.getSimpleCustomActions(metadata);
    }

    public static List<SummaryInfo> getAllSummaryOperations(GspMetadata metadata) {
        List<SummaryInfo> operations = new ArrayList<>();
        operations.addAll(SimpleBasicActionSummary.getSimpleBasicActions(metadata));
        operations.addAll(SimpleCustomActionSummary.getSimpleCustomActions(metadata));
        return operations;
    }

    public static List<SummaryInfo> getAllBasicSummaryOperations(GspMetadata metadata) {
        return SimpleBasicActionSummary.getSimpleBasicActions(metadata);
    }

    public static List<SummaryInfo> getAllCustomSummaryOperations(GspMetadata metadata) {
        return SimpleCustomActionSummary.getSimpleCustomActions(metadata);
    }

}
